<?php
class ModelPageMessage extends Model{
	public function saveMessage($data){
		$this->db->query("INSERT INTO " . DB_PREFIX . "message SET nickname = '" . $this->db->escape($data['nickname']) ."', mail='"
		.$this->db->escape($data['mail']) ."', message='".$this->db->escape($data['message']) ."', date_added = NOW()");
	}
	
	public function getAllMessages(){
		return $this->db->query("select * from ". DB_PREFIX . "message order by date_added desc")->rows;
	}
}
?>